using System;
using System.Collections.Generic;
using System.Text;

namespace JobShopModel.Model.FactoryLvl
{
    /// <summary>
    /// Keep track of the time in the simulation
    /// </summary>
    class Clock
    {
        /// <summary>
        /// The duration of the simulation.
        /// </summary>
        Time currentTime;

        /// <summary>
        /// Default Constructor
        /// Init the clock at 0 days and 0 hours
        /// </summary>
        public Clock()
        {
            currentTime = new Time(0, 0.0);
        }


        /// <summary>
        /// Set the clock to an other time.
        /// It INCREMENTS the clock the time passed as a parameter.
        /// It simulation the time elapsed for a task for exemple.
        /// </summary>
        /// <param name="duration">period or duration of a element</param>
        public void increment(Time duration)
        {
            this.currentTime += duration;
        }

        public Time CurrentTime
        {
            get { return this.currentTime; }
            set { this.currentTime = value; }
        }

        public override string  ToString()
        {
 	         return "Current time is: "+CurrentTime.ToString();
        }
        
    }
}
